/**
 * 
 */
package gaml.yaml;

import java.util.ArrayList;
import java.util.HashMap;


/**
 * implementation of scalar (single value) yaml node
 * @author shnireck_vi
 *
 */
public class ScalarNode extends YamlNode {
	String value = "";
	
	public ScalarNode (YamlNode parent) {
		this.parent = parent;
		if (null != parent) level = (parent.getLevel () + 1);
	}
	
	public YamlNode addChild (YamlNode value) { return this; }

	@Override
	public YamlNode addChild (YamlNode key, YamlNode val) { return this; }

	@Override
	public ArrayList <YamlNode> getSequenceChildren () { return new ArrayList <YamlNode> (); }

	@Override
	public HashMap <YamlNode, YamlNode> getMappingChildren () { return new HashMap <YamlNode, YamlNode> (); }

	@Override
	public YamlNode getParent () { return parent; }

	@Override
	public String getValue () { return value; }

	@Override
	public YamlNode setValue (String value) {
		this.value = value;
		return this;
	}

	@Override
	public YamlNode getChild (YamlNode key) { return null; }

	@Override
	public YamlNode getChild (int index) { return null; }

	@Override
	public boolean isEmpty () { return getValue ().isEmpty (); }
}